package shsi2rpt

class OrdinaryPressureCvdController {
    def dynamicQueryService
    def ordinaryPressureCvd(){
        def pageCurrent = params.pageCurrent ? Integer.parseInt(params.pageCurrent) : 1
        def pageSize = params.pageSize ? Integer.parseInt(params.pageSize) : 10
        params.startno = (pageSize * (pageCurrent - 1)) + 1
        params.endno = pageSize * pageCurrent
        def tableHeadList=[]
        def ordinaryPressureCvd=[]
        def pageSizeList = [10,20,50,100]
        def totalCount =0

        if(params.EXPORT_CONTENT_NAME=='Excel'){
            params.SYS_QUERY_NAME = 'ordinaryPressureCvd'
            ordinaryPressureCvd = dynamicQueryService.queryForList(params)
            if (ordinaryPressureCvd.size() > 0) {
                tableHeadList = ordinaryPressureCvd[0].keySet()
            }
            params.SYS_QUERY_NAME = 'ordinaryPressureCvdCount'
            totalCount = dynamicQueryService.queryForList(params)[0].TOTALCOUNT
        }
        [startno:params.startno?:'',
         endno:params.endno?:'',
         pageSize:pageSize,
         totalCount: totalCount,
         pageSizeList: pageSizeList,
         tableHeadList:tableHeadList,
         ordinaryPressureCvd:ordinaryPressureCvd
        ]
    }
}
